<?php
namespace Home\Controller;

class ZongheController extends HomeController{
		
	//系统首页
	public function index(){
		$count = M('FilmInfo')->where('film_type = 5')->count();
		$page = new \Think\Page($count,20);
		$res = M('FilmInfo')->where('film_type = 5')->limit($page->firstRow.','.$page->listRows)->select();
		$film_type = C("FILM_TYPE");
		foreach($res as $key => $val)
		{
			$res[$key]['film_type'] = $film_type[$val['film_type']];
			$res[$key]['film_publish_time'] = date('Y-m-d h:i:s',$val['film_publish_time']);
			$res[$key]['film_name_real'] = explode('/',$val['film_name_real'])[0];
		}
		$this->assign('page',$page->show());
		$this->assign('count',$count);
		$this->assign('data',$res);
		$this->display();
	}
}	
?>